home *** CD-ROM | disk | FTP | other *** search
Wrap
Text File | 1993-06-18 | 27.1 KB | 744 lines | [ TEXT/MPS ]
File #1: b:-archives:93/03/25.Dev.CD.Version:AppsToGo.CD:DTS.Draw:Window.c File #2: a:Desktop Folder:AppsToGo.src:DTS.Draw:Window.c Nonmatching lines (File "b:-archives:93/03/25.Dev.CD.Version:AppsToGo.CD:DTS.Draw:Window.c"; Line 7; File "a:Desktop Folder:AppsToGo.src:DTS.Draw:Window.c"; Line 7) ** Copyright © 1990-1992 Apple Computer, Inc. ** Copyright © 1990-1993 Apple Computer, Inc. Extra lines in 2nd before 11 in 1st (File "b:-archives:93/03/25.Dev.CD.Version:AppsToGo.CD:DTS.Draw:Window.c"; Line Δ11; File "a:Desktop Folder:AppsToGo.src:DTS.Draw:Window.c"; Line 11:18) /* You may incorporate this sample code into your applications without ** restriction, though the sample code has been provided "AS IS" and the ** responsibility for its operation is 100% yours. However, what you are ** not permitted to do is to redistribute the source as "DSC Sample Code" ** after having made changes. If you're going to re-distribute the source, ** we require that you make it clear in the source that the code was ** descended from Apple Sample Code, but that you've made changes. */ Extra lines in 2nd before 85 in 1st (File "b:-archives:93/03/25.Dev.CD.Version:AppsToGo.CD:DTS.Draw:Window.c"; Line Δ85; File "a:Desktop Folder:AppsToGo.src:DTS.Draw:Window.c"; Line 93:95) static void DrawPageGrid(void); #define kDataAreaPadding 0 Extra lines in 1st before 98 in 2nd (File "b:-archives:93/03/25.Dev.CD.Version:AppsToGo.CD:DTS.Draw:Window.c"; Line 87; File "a:Desktop Folder:AppsToGo.src:DTS.Draw:Window.c"; Line Δ98) Nonmatching lines (File "b:-archives:93/03/25.Dev.CD.Version:AppsToGo.CD:DTS.Draw:Window.c"; Line 207:209; File "a:Desktop Folder:AppsToGo.src:DTS.Draw:Window.c"; Line 217:223) else if (!shiftMod) /* No object was clicked on, */ DoTreeSelect(root, SELECTOFF); /* so if not a shift-click, */ /* deselect everything. */ else { /* No object was clicked on... */ if (!shiftMod) /* If not a shift-click, */ DoTreeSelect(root, SELECTOFF); /* deselect everything. */ AddOrSizeObj(frHndl, hitObj, &click); /* Do extend select. */ } Nonmatching lines (File "b:-archives:93/03/25.Dev.CD.Version:AppsToGo.CD:DTS.Draw:Window.c"; Line 369; File "a:Desktop Folder:AppsToGo.src:DTS.Draw:Window.c"; Line 383) LayerObj windowLayer, backLayer; LayerObj wlyr, blyr; Nonmatching lines (File "b:-archives:93/03/25.Dev.CD.Version:AppsToGo.CD:DTS.Draw:Window.c"; Line 383; File "a:Desktop Folder:AppsToGo.src:DTS.Draw:Window.c"; Line 397) NewLayer(&windowLayer, nil, WindowLayerProc, (*frHndl)->fileState.window, 0, (long)&drawInfo); NewLayer(&wlyr, nil, WindowLayerProc, (*frHndl)->fileState.window, 0, (long)&drawInfo); Nonmatching lines (File "b:-archives:93/03/25.Dev.CD.Version:AppsToGo.CD:DTS.Draw:Window.c"; Line 386; File "a:Desktop Folder:AppsToGo.src:DTS.Draw:Window.c"; Line 400) NewLayer(&backLayer, windowLayer, WorkLayerProc, nil, 0, (long)&drawInfo); NewLayer(&blyr, wlyr, WorkLayerProc, nil, 0, (long)&drawInfo); Nonmatching lines (File "b:-archives:93/03/25.Dev.CD.Version:AppsToGo.CD:DTS.Draw:Window.c"; Line 389; File "a:Desktop Folder:AppsToGo.src:DTS.Draw:Window.c"; Line 403) InvalLayer(windowLayer, GetEffectiveDstRect(windowLayer), false); InvalLayer(wlyr, GetEffectiveDstRect(wlyr), false); Nonmatching lines (File "b:-archives:93/03/25.Dev.CD.Version:AppsToGo.CD:DTS.Draw:Window.c"; Line 392; File "a:Desktop Folder:AppsToGo.src:DTS.Draw:Window.c"; Line 406) UpdateLayer(windowLayer); UpdateLayer(wlyr); Nonmatching lines (File "b:-archives:93/03/25.Dev.CD.Version:AppsToGo.CD:DTS.Draw:Window.c"; Line 397; File "a:Desktop Folder:AppsToGo.src:DTS.Draw:Window.c"; Line 411) DisposeThisAndBelowLayers(windowLayer); DisposeThisAndBelowLayers(wlyr); Nonmatching lines (File "b:-archives:93/03/25.Dev.CD.Version:AppsToGo.CD:DTS.Draw:Window.c"; Line 428; File "a:Desktop Folder:AppsToGo.src:DTS.Draw:Window.c"; Line 442:444) OSErr err; OSErr err; Rect rct; TreeObjHndl root; Extra lines in 2nd before 431 in 1st (File "b:-archives:93/03/25.Dev.CD.Version:AppsToGo.CD:DTS.Draw:Window.c"; Line Δ431; File "a:Desktop Folder:AppsToGo.src:DTS.Draw:Window.c"; Line 447:450) rct = GetDataArea(root = (*frHndl)->d.doc.root); SetDataArea(root, rct.right, rct.bottom); Extra lines in 2nd before 519 in 1st (File "b:-archives:93/03/25.Dev.CD.Version:AppsToGo.CD:DTS.Draw:Window.c"; Line Δ519; File "a:Desktop Folder:AppsToGo.src:DTS.Draw:Window.c"; Line 539:540) TreeObjHndl root; Rect rct; Nonmatching lines (File "b:-archives:93/03/25.Dev.CD.Version:AppsToGo.CD:DTS.Draw:Window.c"; Line 521:526; File "a:Desktop Folder:AppsToGo.src:DTS.Draw:Window.c"; Line 543:550) if (!afterUndo) /* Before an undo operation we deselect everything. */ DoTreeSelect((*frHndl)->d.doc.root, SELECTOFF); /* Only what was undone should end up selected. */ if (afterUndo) { root = (*frHndl)->d.doc.root; if (!afterUndo) /* Before an undo operation we deselect everything. */ DoTreeSelect(root, SELECTOFF); /* Only what was undone should end up selected. */ if (afterUndo) { rct = GetDataArea(root); SetDataArea(root, rct.right, rct.bottom); Extra lines in 2nd before 684 in 1st (File "b:-archives:93/03/25.Dev.CD.Version:AppsToGo.CD:DTS.Draw:Window.c"; Line Δ684; File "a:Desktop Folder:AppsToGo.src:DTS.Draw:Window.c"; Line 708:710) case mOther: redrawMenuBar = DoAdjustOtherMenu(window); break; Nonmatching lines (File "b:-archives:93/03/25.Dev.CD.Version:AppsToGo.CD:DTS.Draw:Window.c"; Line 889:911; File "a:Desktop Folder:AppsToGo.src:DTS.Draw:Window.c"; Line 916:935) void DoGroup(FileRecHndl frHndl) { TreeObjHndl root, group, child; short gnum, cnum; Rect groupRct; NewDocumentUndo(frHndl); root = (*frHndl)->d.doc.root; for (gnum = 0; gnum < (*root)->numChildren; ++gnum) if (DoTreeObjMethod(GetChildHndl(root, gnum), GETSELECTMESSAGE, 0)) break; if (!(group = NewChild(GROUP_EDIT, root, gnum, GROUPOBJ, 0))) return; groupRct = GetSelectedArea(root); for (cnum = (*root)->numChildren - 1; cnum > gnum; --cnum) { if (DoTreeObjMethod(child = GetChildHndl(root, cnum), GETSELECTMESSAGE, 0)) { DoTreeObjMethodClipped(child, SETSELECTMESSAGE, SELECTOFF); MoveChild(GROUP_EDIT, root, cnum, group, 0); } } mDerefGroup(group)->group = groupRct; Rect GetDataArea(TreeObjHndl root) { TreeObjHndl child; short cnum; Rect areaRct, rct; Boolean first; SetRect(&areaRct, 0, 0, 0, 0); for (first = true, cnum = (*root)->numChildren; cnum;) { child = GetChildHndl(root, --cnum); DoTreeObjMethod(child, GETBBOXMESSAGE, (long)&rct); if (!EmptyRect(&rct)) { if (first) { areaRct = rct; first = false; } else UnionRect(&areaRct, &rct, &areaRct); } } return(areaRct); Nonmatching lines (File "b:-archives:93/03/25.Dev.CD.Version:AppsToGo.CD:DTS.Draw:Window.c"; Line 921:940; File "a:Desktop Folder:AppsToGo.src:DTS.Draw:Window.c"; Line 945:959) void DoUngroup(FileRecHndl frHndl) { TreeObjHndl root, group; short gnum, cnum; NewDocumentUndo(frHndl); root = (*frHndl)->d.doc.root; for (gnum = (*root)->numChildren; gnum;) { if (DoTreeObjMethod(group = GetChildHndl(root, --gnum), GETSELECTMESSAGE, 0)) { if ((*group)->type == GROUPOBJ) { DoTreeSelect(group, SELECTOFF); for (cnum = (*group)->numChildren; cnum;) { MoveChild(UNGROUP_EDIT, group, --cnum, root, gnum + 1); DoTreeSelect(GetChildHndl(root, gnum + 1), SELECTON); } DisposeChild(UNGROUP_EDIT, root, gnum); } } } void SetDataArea(TreeObjHndl root, short h, short v) { if (h != kwNoChange) { h /= (7 * 72); ++h; h *= (7 * 72); } if (v != kwNoChange) { v /= (10 * 72); ++v; v *= (10 * 72); } SetDocSize(mDerefRoot(root)->frHndl, h, v); Extra lines in 1st before 965 in 2nd (File "b:-archives:93/03/25.Dev.CD.Version:AppsToGo.CD:DTS.Draw:Window.c"; Line 946:947; File "a:Desktop Folder:AppsToGo.src:DTS.Draw:Window.c"; Line Δ965) /*****************************************************************************/ /*****************************************************************************/ Nonmatching lines (File "b:-archives:93/03/25.Dev.CD.Version:AppsToGo.CD:DTS.Draw:Window.c"; Line 952:973; File "a:Desktop Folder:AppsToGo.src:DTS.Draw:Window.c"; Line 969:1059) void AddOrSizeObj(FileRecHndl frHndl, TreeObjHndl hndl, ClickInfo *click) { TreeObjHndl root; WindowPtr window; short cnum, h, w; LayerObj windowLayer, workLayer, backLayer; Rect oldRct, newRct, rct; OSErr err; LayerDrawInfo drawInfo; Boolean adding, tool, keepTool, newTool; NewDocumentUndo(frHndl); root = (*frHndl)->d.doc.root; window = (*frHndl)->fileState.window; tool = GetTool(); keepTool = GetToolPersistence(); adding = newTool = false; if (!hndl) { /* If hndl == nil, then we are adding a new object. */ adding = true; DoTreeSelect(root, SELECTOFF); /* Turn off all old selections. */ void DoGroup(FileRecHndl frHndl) { TreeObjHndl root, group, child; short gnum, cnum; Rect groupRct; NewDocumentUndo(frHndl); root = (*frHndl)->d.doc.root; for (gnum = 0; gnum < (*root)->numChildren; ++gnum) if (DoTreeObjMethod(GetChildHndl(root, gnum), GETSELECTMESSAGE, 0)) break; if (!(group = NewChild(GROUP_EDIT, root, gnum, GROUPOBJ, 0))) return; groupRct = GetSelectedArea(root); for (cnum = (*root)->numChildren - 1; cnum > gnum; --cnum) { if (DoTreeObjMethod(child = GetChildHndl(root, cnum), GETSELECTMESSAGE, 0)) { DoTreeObjMethodClipped(child, SETSELECTMESSAGE, SELECTOFF); MoveChild(GROUP_EDIT, root, cnum, group, 0); } } mDerefGroup(group)->group = groupRct; } /*****************************************************************************/ #pragma segment DrawDoc void DoUngroup(FileRecHndl frHndl) { TreeObjHndl root, group; short gnum, cnum; NewDocumentUndo(frHndl); root = (*frHndl)->d.doc.root; for (gnum = (*root)->numChildren; gnum;) { if (DoTreeObjMethod(group = GetChildHndl(root, --gnum), GETSELECTMESSAGE, 0)) { if ((*group)->type == GROUPOBJ) { DoTreeSelect(group, SELECTOFF); for (cnum = (*group)->numChildren; cnum;) { MoveChild(UNGROUP_EDIT, group, --cnum, root, gnum + 1); DoTreeSelect(GetChildHndl(root, gnum + 1), SELECTON); } DisposeChild(UNGROUP_EDIT, root, gnum); } } } } /*****************************************************************************/ /*****************************************************************************/ /*****************************************************************************/ #pragma segment DrawDoc void AddOrSizeObj(FileRecHndl frHndl, TreeObjHndl hndl, ClickInfo *click) { TreeObjHndl root, cobj, origHndl, oldHndl; WindowPtr window; short cnum, h, w, i; short adding, extSelect; LayerObj wlyr, wklyr, blyr; Rect oldRct, newRct, rct, extRct1, extRct2, extRct3; OSErr err; LayerDrawInfo drawInfo; Boolean tool, keepTool, newTool; Point curMouse, org, oldOrg; root = (*frHndl)->d.doc.root; window = (*frHndl)->fileState.window; tool = GetTool(); keepTool = GetToolPersistence(); adding = false; extSelect = false; newTool = false; if (!hndl) { /* If hndl == nil, then we are adding a new object. */ adding = true; if (!tool) extSelect = true; else DoTreeSelect(root, SELECTOFF); /* Turn off all old selections. */ Nonmatching lines (File "b:-archives:93/03/25.Dev.CD.Version:AppsToGo.CD:DTS.Draw:Window.c"; Line 979; File "a:Desktop Folder:AppsToGo.src:DTS.Draw:Window.c"; Line 1065:1067) hndl = NewChild(NEW_EDIT, root, cnum = 0, (RECTOBJ - 1) + tool, 0); i = (extSelect) ? EXTSELECTOBJ : ((RECTOBJ - 1) + tool); hndl = NewChild(NO_EDIT, root, cnum = 0, i, 0); Nonmatching lines (File "b:-archives:93/03/25.Dev.CD.Version:AppsToGo.CD:DTS.Draw:Window.c"; Line 991:996; File "a:Desktop Folder:AppsToGo.src:DTS.Draw:Window.c"; Line 1079:1080) DoTreeObjMethod(hndl, SETBBOXMESSAGE, (long)&rct); DoTreeObjMethod(hndl, UNDOMESSAGE, UNDOFROMDOC); /* This is a safe (non-drawing) way to deselect the object. ** Just forcing the select field to false does not update ** the numSelected field in the root object. We have to ** account for the deselection. */ DoTreeObjMethod(hndl, SETOBJRECTMESSAGE, (long)&rct); DoTreeObjMethod(hndl, SETSELECTMESSAGE, (SELECTOFF | SELECTNODRAW)); Extra lines in 2nd before 1000 in 1st (File "b:-archives:93/03/25.Dev.CD.Version:AppsToGo.CD:DTS.Draw:Window.c"; Line Δ1000; File "a:Desktop Folder:AppsToGo.src:DTS.Draw:Window.c"; Line 1084) NewDocumentUndo(frHndl); Nonmatching lines (File "b:-archives:93/03/25.Dev.CD.Version:AppsToGo.CD:DTS.Draw:Window.c"; Line 1002; File "a:Desktop Folder:AppsToGo.src:DTS.Draw:Window.c"; Line 1087:1090) /* Out of memory. I would handle this case better if it weren't just sample code. */ /* Out of memory. I would handle this case better if it weren't just sample code. ** Given that there are no complex objects, we actually can't run out of memory ** due to this operation. However, there may someday be a pixmap type of object, ** whose memory hit could be substantial. */ Nonmatching lines (File "b:-archives:93/03/25.Dev.CD.Version:AppsToGo.CD:DTS.Draw:Window.c"; Line 1009:1017; File "a:Desktop Folder:AppsToGo.src:DTS.Draw:Window.c"; Line 1097:1105) NewLayer(&windowLayer, nil, WindowLayerProc, window, 0, (long)&drawInfo); err = NewLayer(&workLayer, windowLayer, WorkLayerProc, nil, 0, (long)&drawInfo); if (!err) err = NewLayer(&backLayer, workLayer, BackLayerProc, nil, 0, (long)&drawInfo); if (err) DisposeThisAndBelowLayers(workLayer); /* The above code creates the necessary offscreen layers for the following editing. ** The windowLayer is bound to succeed at getting created, as it uses the window, ** instead of creating an offscreen GWorld. The workLayer and backLayer creations ** may fail. If they do, then we will only have a windowLayer. The windowLayer NewLayer(&wlyr, nil, WindowLayerProc, window, 0, (long)&drawInfo); err = NewLayer(&wklyr, wlyr, WorkLayerProc, nil, 0, (long)&drawInfo); if (!err) err = NewLayer(&blyr, wklyr, BackLayerProc, nil, 0, (long)&drawInfo); if (err) DisposeThisAndBelowLayers(wklyr); /* The above code creates the necessary offscreen layers for the following editing. ** The window layer is bound to succeed at getting created, as it uses the window, ** instead of creating an offscreen GWorld. The work layer and back layer creations ** may fail. If they do, then we will only have a window layer. The window layer Nonmatching lines (File "b:-archives:93/03/25.Dev.CD.Version:AppsToGo.CD:DTS.Draw:Window.c"; Line 1028; File "a:Desktop Folder:AppsToGo.src:DTS.Draw:Window.c"; Line 1116) InvalLayer(windowLayer, rct, true); InvalLayer(wlyr, rct, true); Nonmatching lines (File "b:-archives:93/03/25.Dev.CD.Version:AppsToGo.CD:DTS.Draw:Window.c"; Line 1032:1051; File "a:Desktop Folder:AppsToGo.src:DTS.Draw:Window.c"; Line 1120:1194) while (StillDown()) { DoTreeObjMethod(hndl, GETBBOXMESSAGE, (long)&oldRct); if (DoTreeObjMethod(hndl, SIZEMESSAGE, (long)click)) { /* If new size... */ DoTreeObjMethod(hndl, GETBBOXMESSAGE, (long)&newRct); if (!err) { /* If we have all offscreen layers... */ if (click->grabber) InsetRect(&newRct, -3, -3); InvalLayer(windowLayer, newRct, true); UpdateLayer(windowLayer); } else { /* If we only have windowLayer... */ DoTreeObjMethod(hndl, SETBBOXMESSAGE, (long)&oldRct); DoTreeObjMethodClipped(hndl, DRAWMESSAGE, DRAWGHOST); DoTreeObjMethod(hndl, SETBBOXMESSAGE, (long)&newRct); DoTreeObjMethodClipped(hndl, DRAWMESSAGE, DRAWGHOST); } } } DoTreeObjMethod(hndl, GETBBOXMESSAGE, (long)&rct); origHndl = hndl; HandToHand((Handle *)&origHndl); while (StillDown()) { DoTreeObjMethod(hndl, GETOBJRECTMESSAGE, (long)&oldRct); oldHndl = hndl; HandToHand((Handle *)&oldHndl); if (DoTreeObjMethod(hndl, SIZEMESSAGE, (long)click)) { /* If new size... */ DoTreeObjMethod(hndl, GETOBJRECTMESSAGE, (long)&newRct); if (!err) { /* If we have all offscreen layers... */ DoTreeObjMethod(hndl, GETBBOXMESSAGE, (long)&rct); if (click->grabber) InsetRect(&rct, -3, -3); InvalLayer(wlyr, rct, true); UpdateLayer(wlyr); } else { /* If we only have wlyr... */ SwapTreeObjData(hndl, oldHndl); if (!EqualTreeObjData(hndl, origHndl)) DoTreeObjMethodClipped(hndl, DRAWMESSAGE, DRAWGHOST); SwapTreeObjData(hndl, oldHndl); if (!EqualTreeObjData(hndl, origHndl)) DoTreeObjMethodClipped(hndl, DRAWMESSAGE, DRAWGHOST); } } DisposeHandle((Handle)oldHndl); GetMouse(&curMouse); GetContentRect(window, &rct); if (!PtInRect(curMouse, &rct)) { GetContentOrigin(window, &org); oldOrg = org; if (curMouse.h < rct.left) org.h += (curMouse.h - rct.left); if (curMouse.h > rct.right) org.h += (curMouse.h - rct.right); if (curMouse.v < rct.top) org.v += (curMouse.v - rct.top); if (curMouse.v > rct.bottom) org.v += (curMouse.v - rct.bottom); rct = GetDataArea(root); if (rct.right < curMouse.h) rct.right = curMouse.h; if (rct.bottom < curMouse.v) rct.bottom = curMouse.v; SetDataArea(root, rct.right, rct.bottom); SetContentOrigin(window, org.h, org.v); GetContentOrigin(window, &org); if (!err) { if ((org.h != oldOrg.h) || (org.v != oldOrg.v)) { DisposeThisAndBelowLayers(wlyr); DoImageDocument(frHndl); NewLayer(&wlyr, nil, WindowLayerProc, window, 0, (long)&drawInfo); err = NewLayer(&wklyr, wlyr, WorkLayerProc, nil, 0, (long)&drawInfo); if (!err) err = NewLayer(&blyr, wklyr, BackLayerProc, nil, 0, (long)&drawInfo); if (err) DisposeThisAndBelowLayers(wklyr); GetContentRect(window, &rct); InvalLayer(wlyr, rct, false); /* Force full redraw. */ } } else DoImageDocument(frHndl); } else { rct = GetDataArea(root); SetDataArea(root, rct.right, rct.bottom); } } if (origHndl) DisposeHandle((Handle)origHndl); rct = GetDataArea(root); SetDataArea(root, rct.right, rct.bottom); DoTreeObjMethod(hndl, GETOBJRECTMESSAGE, (long)&rct); Nonmatching lines (File "b:-archives:93/03/25.Dev.CD.Version:AppsToGo.CD:DTS.Draw:Window.c"; Line 1061:1062; File "a:Desktop Folder:AppsToGo.src:DTS.Draw:Window.c"; Line 1204:1205) RevertEdit(hndl); /* Don't create a new object that's too small. */ hndl = nil; /* We didn't change anything, so flag this situation. */ DisposeChild(NO_EDIT, root, 0); /* Don't create a new object that's too small. */ hndl = nil; /* We didn't change anything, so flag this situation. */ Nonmatching lines (File "b:-archives:93/03/25.Dev.CD.Version:AppsToGo.CD:DTS.Draw:Window.c"; Line 1069; File "a:Desktop Folder:AppsToGo.src:DTS.Draw:Window.c"; Line 1212) DoTreeObjMethod(hndl, SETBBOXMESSAGE, (long)&rct); /* Make it minimum. */ DoTreeObjMethod(hndl, SETOBJRECTMESSAGE, (long)&rct); /* Make it minimum. */ Nonmatching lines (File "b:-archives:93/03/25.Dev.CD.Version:AppsToGo.CD:DTS.Draw:Window.c"; Line 1075:1086; File "a:Desktop Folder:AppsToGo.src:DTS.Draw:Window.c"; Line 1218:1274) SetWindowDirty(window); if (err) DoTreeObjMethod(hndl, DRAWMESSAGE, DRAWOBJ); /* If we have only a windowLayer, then we haven't really been generating a ** complete image. Redraw the document so that a full image is shown. */ DoTreeSelect(hndl, SELECTON); /* Make sure the object is selected. */ } DisposeThisAndBelowLayers(windowLayer); /* Clean up. */ } if (adding) { /* If we are adding, we haven't handled posting the addition ** for undo. The reason for this is that the user may not ** actually add an object. If they just click and release, ** there is no object added. If we add the child with undo ** posting, and then remove it if the user doesn't grow it ** out, then we may lose some old undo info. If the user ** doesn't grow out the object, the operation is a NOP, and ** so old undo information shouldn't be lost. */ if (extSelect) { /* We only created the object for extend-select purposes. */ DoTreeObjMethod(hndl, GETBBOXMESSAGE, (long)&extRct1); for (i = (*root)->numChildren - 1; i; --i) { cobj = GetChildHndl(root, i); DoTreeObjMethod(cobj, GETBBOXMESSAGE, (long)&extRct2); SectRect(&extRct1, &extRct2, &extRct3); if (EqualRect(&extRct2, &extRct3)) DoTreeObjMethodClipped(cobj, SETSELECTMESSAGE, SELECTTOGGLE); } DisposeChild(NO_EDIT, root, 0); /* We're done with it, so kill it. */ } else { NewDocumentUndo(frHndl); hndl = CopyChild(NEW_EDIT, root, 0, root, 0, false); DisposeChild(NO_EDIT, root, 1); } /* We just created a posted copy of the child, just as if we had called ** NewChild. We also disposed of the temporary unposted copy of the child. ** The only problem is that objects entering the document get flagged as ** selected. This means that when we select the object, nothing happens ** on the screen because the object thinks it is already selected. */ if (!extSelect) if (hndl) DoTreeObjMethod(hndl, SETSELECTMESSAGE, (SELECTOFF | SELECTNODRAW)); /* Now the select grabbers can be drawn. */ } rct = GetDataArea(root); SetDataArea(root, rct.right, rct.bottom); SetWindowDirty(window); if (err) DoImageDocument(frHndl); /* If we have only a wlyr, then we haven't really been generating a ** complete image. Redraw the document so that a full image is shown. */ if (!extSelect) DoTreeObjMethodClipped(hndl, SETSELECTMESSAGE, SELECTON); /* Make sure the object is selected. */ } DisposeThisAndBelowLayers(wlyr); /* Clean up. */ } if (extSelect) DoImageDocument(frHndl); /* Since we have killed the extend-select object, erase it from the screen. */ Nonmatching lines (File "b:-archives:93/03/25.Dev.CD.Version:AppsToGo.CD:DTS.Draw:Window.c"; Line 1121; File "a:Desktop Folder:AppsToGo.src:DTS.Draw:Window.c"; Line 1309) ** By setting the dstRect to this smaller rect, workLayer and backLayer ** By setting the dstRect to this smaller rect, work layer and back layer Extra lines in 2nd before 1144 in 1st (File "b:-archives:93/03/25.Dev.CD.Version:AppsToGo.CD:DTS.Draw:Window.c"; Line Δ1144; File "a:Desktop Folder:AppsToGo.src:DTS.Draw:Window.c"; Line 1332) DrawPageGrid(); Extra lines in 2nd before 1196 in 1st (File "b:-archives:93/03/25.Dev.CD.Version:AppsToGo.CD:DTS.Draw:Window.c"; Line Δ1196; File "a:Desktop Folder:AppsToGo.src:DTS.Draw:Window.c"; Line 1385) DrawPageGrid(); Extra lines in 2nd before 1236 in 1st (File "b:-archives:93/03/25.Dev.CD.Version:AppsToGo.CD:DTS.Draw:Window.c"; Line Δ1236; File "a:Desktop Folder:AppsToGo.src:DTS.Draw:Window.c"; Line 1426:1429) for (cnum = (*drawInfo.root)->numChildren - 1; cnum > drawInfo.cnum; --cnum) { chndl = GetChildHndl(drawInfo.root, cnum); DoTreeDraw(chndl, DRAWSELECT); } Nonmatching lines (File "b:-archives:93/03/25.Dev.CD.Version:AppsToGo.CD:DTS.Draw:Window.c"; Line 1255:1264; File "a:Desktop Folder:AppsToGo.src:DTS.Draw:Window.c"; Line 1449:1495) void SlideSelection(FileRecHndl frHndl, ClickInfo *click) { LayerDrawInfo drawInfo; WindowPtr window; LayerObj windowLayer, workLayer, backLayer; Point lastMouse, curMouse; short cnum; TreeObjHndl root, chndl; Rect newLoc, selectRct; Boolean changed; void DrawPageGrid(void) { WindowPtr curPort; short x1, x2, y1, y2, i; if (!gPrintPage) { GetPort(&curPort); PenPat((ConstPatternParam)&qd.gray); x1 = curPort->portRect.left / (7 * 72); x1 *= (7 * 72); x2 = curPort->portRect.right / (7 * 72); x2 *= (7 * 72); y1 = curPort->portRect.top / (10 * 72); y1 *= (10 * 72); y2 = curPort->portRect.bottom / (10 * 72); y2 *= (10 * 72); for (i = x1; i <= x2; i += (7 * 72)) { MoveTo(i - 1, -1); Line (0, 16383); } for (i = y1; i <= y2; i += (10 * 72)) { MoveTo(-1, i - 1); Line (16383, 0); } PenNormal(); } } /*****************************************************************************/ #pragma segment DrawDoc void SlideSelection(FileRecHndl frHndl, ClickInfo *click) { LayerDrawInfo drawInfo; WindowPtr window; LayerObj wlyr, wklyr, blyr; Point lastMouse, curMouse; short cnum; TreeObjHndl root, chndl; Rect newLoc, selectRct, rct; Point oldOrg, org; Boolean changed; OSErr err; Nonmatching lines (File "b:-archives:93/03/25.Dev.CD.Version:AppsToGo.CD:DTS.Draw:Window.c"; Line 1279:1281; File "a:Desktop Folder:AppsToGo.src:DTS.Draw:Window.c"; Line 1510:1512) NewLayer(&windowLayer, nil, WindowLayerProc, window, 0, (long)&drawInfo); NewLayer(&workLayer, windowLayer, WorkLayerProc, nil, 0, (long)&drawInfo); NewLayer(&backLayer, workLayer, BackLayerProc, nil, 0, (long)&drawInfo); NewLayer(&wlyr, nil, WindowLayerProc, window, 0, (long)&drawInfo); err = NewLayer(&wklyr, wlyr, WorkLayerProc, nil, 0, (long)&drawInfo); if (!err) err = NewLayer(&blyr, wklyr, BackLayerProc, nil, 0, (long)&drawInfo); Nonmatching lines (File "b:-archives:93/03/25.Dev.CD.Version:AppsToGo.CD:DTS.Draw:Window.c"; Line 1285; File "a:Desktop Folder:AppsToGo.src:DTS.Draw:Window.c"; Line 1516) InvalLayer(windowLayer, selectRct, false); InvalLayer(wlyr, selectRct, false); Nonmatching lines (File "b:-archives:93/03/25.Dev.CD.Version:AppsToGo.CD:DTS.Draw:Window.c"; Line 1301; File "a:Desktop Folder:AppsToGo.src:DTS.Draw:Window.c"; Line 1532) InvalLayer(windowLayer, newLoc, true); InvalLayer(wlyr, newLoc, true); Nonmatching lines (File "b:-archives:93/03/25.Dev.CD.Version:AppsToGo.CD:DTS.Draw:Window.c"; Line 1304:1311; File "a:Desktop Folder:AppsToGo.src:DTS.Draw:Window.c"; Line 1535:1581) UpdateLayer(windowLayer); lastMouse = curMouse; } } if (changed) SetWindowDirty(window); DisposeThisAndBelowLayers(windowLayer); UpdateLayer(wlyr); lastMouse = curMouse; GetContentRect(window, &rct); if (!PtInRect(curMouse, &rct)) { GetContentOrigin(window, &org); oldOrg = org; if (curMouse.h < rct.left) org.h += (curMouse.h - rct.left); if (curMouse.h > rct.right) org.h += (curMouse.h - rct.right); if (curMouse.v < rct.top) org.v += (curMouse.v - rct.top); if (curMouse.v > rct.bottom) org.v += (curMouse.v - rct.bottom); rct = GetDataArea(root); if (rct.right < curMouse.h) rct.right = curMouse.h; if (rct.bottom < curMouse.v) rct.bottom = curMouse.v; SetDataArea(root, rct.right, rct.bottom); SetContentOrigin(window, org.h, org.v); GetContentOrigin(window, &org); if ((org.h != oldOrg.h) || (org.v != oldOrg.v)) { DisposeThisAndBelowLayers(wlyr); DoImageDocument(frHndl); NewLayer(&wlyr, nil, WindowLayerProc, window, 0, (long)&drawInfo); err = NewLayer(&wklyr, wlyr, WorkLayerProc, nil, 0, (long)&drawInfo); if (!err) err = NewLayer(&blyr, wklyr, BackLayerProc, nil, 0, (long)&drawInfo); if (err) DisposeThisAndBelowLayers(wklyr); GetContentRect(window, &rct); InvalLayer(wlyr, rct, false); /* Force full redraw. */ } } else { rct = GetDataArea(root); SetDataArea(root, rct.right, rct.bottom); } } } rct = GetDataArea(root); SetDataArea(root, rct.right, rct.bottom); if (changed) SetWindowDirty(window); DisposeThisAndBelowLayers(wlyr); *** EOF on both files at the same time ***